<extend name="Layout/application"/>
<block name="css">
    <link rel="stylesheet" href="__PUBLIC__/select2/css/select2.min.css">
</block>

<block name="content">
    <div class="row">
        <div class="col-md-12">

            <div class="row">
                <div class="col-md-8">
                    <div class="page-header">
                        <h1>栏目管理</h1>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-md-10">
                    <div class="panel panel-default">
                        <div class="panel-heading">栏目新增</div>

                        <div class="panel-body">
                            <form class="form-horizontal" role="form" method="post" action="{{:U('store_category')}}">
                                <ul class="nav nav-tabs" role="tablist">
                                    <li role="presentation" class="active"><a href="#home" role="tab" data-toggle="tab">添加栏目</a></li>
                                    <li role="presentation"><a href="#profile" role="tab" data-toggle="tab">栏目内容</a></li>
                                </ul>
                                <div class="tab-content">
                                    <div role="tabpanel" class="tab-pane active" id="home">
                                        <div class="form-group">
                                            <label for="parent_name" class="col-sm-2 control-label">父栏目名称</label>
                                            <div class="col-sm-8">
                                                <select name="parent_id" id="parent_name" class="form-control">
                                                    <option value="0">顶级栏目</option>
                                                    <volist name="categories" id="c">
                                                        <option value="{{$c.id}}">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{$c.name}}</option>
                                                    </volist>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="name" class="col-sm-2 control-label">栏目名称</label>
                                            <div class="col-sm-8">
                                                <input type="text" name="name" class="form-control" id="name" placeholder="栏目名称">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="pinyin" class="col-sm-2 control-label">栏目拼音</label>
                                            <div class="col-sm-8">
                                                <input type="text" name="pinyin" class="form-control" id="pinyin" placeholder="栏目拼音">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="type" class="col-sm-2 control-label">类型</label>
                                            <div class="col-sm-4" id="type" >
                                                <input type="radio" name="type"   value="0" checked>封面<br/>
                                                <input type="radio" name="type"   value="1">列表<br/>
                                                <input type="radio" name="type"   value="2">URL跳转
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="type" class="col-sm-2 control-label">URL地址</label>
                                            <div class="col-sm-6" id="url" >
                                                <input type="text" name="url" class="form-control"  value="" placeholder="如果选择了URL跳转，请填写地址">
                                            </div>
                                        </div>
                                    </div>

                                    <div role="tabpanel" class="tab-pane" id="profile">
                                        <div class="form-group">
                                        <div class="col-sm-10">
                                            <textarea name="content" class="form-control" id="content" cols="30" rows="10"></textarea>
                                        </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="type" class="col-sm-2 control-label">是否显示</label>
                                    <div class="col-sm-4" id="is_set" >
                                        <input type="radio" name="is_show"  value="1" >是<br/>
                                        <input type="radio" name="is_show"  value="0" checked>否<br/>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-sm-offset-2 col-sm-10">
                                        <button type="submit" class="btn btn-default">添加</button>
                                        <button type="button" class="btn btn-default" id="return">返回</button>
                                    </div>
                                </div>
                            </form>

                        </div>
                    </div>
                </div>


                <div class="col-md-2">
                    <div class="list-group">

                    </div>
                </div>
            </div>
        </div>
    </div>
</block>
<block name="js">

    <script src="__PUBLIC__/ckeditor/ckeditor.js"></script>
    <script type="text/javascript" src="__PUBLIC__/ckfinder/ckfinder.js"></script>

    <script src="__PUBLIC__/select2/js/select2.min.js"></script>
    <script src="__PUBLIC__/select2/js/i18n/zh-CN.js"></script>

    <script>
        CKEDITOR.replace('content',
                {
                    filebrowserBrowseUrl: '__PUBLIC__/ckfinder/ckfinder.html',
                    filebrowserImageBrowseUrl: '__PUBLIC__/ckfinder/ckfinder.html?type=Images',
                    filebrowserFlashBrowseUrl: '__PUBLIC__/ckfinder/ckfinder.html?type=Flash',
                    filebrowserUploadUrl: '__PUBLIC__/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
                    filebrowserImageUploadUrl: '__PUBLIC__/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
                    filebrowserFlashUploadUrl: '__PUBLIC__/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'
                });




        $(function () {

            $('select').select2();

            $('#return').click(function () {
                window.history.back(-1);
            })

        })
    </script>
</block>